file vTechInv_csv / 'output/vTechInv.csv'/;
vTechInv_csv.lp = 1;
vTechInv_csv.nd = 1;
vTechInv_csv.nz = 1e-25;
vTechInv_csv.nr = 2;
put vTechInv_csv;
put "tech,region,year,value"/;
loop((tech,region,year)$(vTechInv.l(tech,region,year) and mMidMilestone(year)), put tech.tl:0",", region.tl:0",", year.tl:0","vTechInv.l(tech,region,year):0:15/;);
putclose; 
file vTechEac_csv / 'output/vTechEac.csv'/;
vTechEac_csv.lp = 1;
vTechEac_csv.nd = 1;
vTechEac_csv.nz = 1e-25;
vTechEac_csv.nr = 2;
put vTechEac_csv;
put "tech,region,year,value"/;
loop((tech,region,year)$(vTechEac.l(tech,region,year) and mMidMilestone(year)), put tech.tl:0",", region.tl:0",", year.tl:0","vTechEac.l(tech,region,year):0:15/;);
putclose; 
file vTechRetCost_csv / 'output/vTechRetCost.csv'/;
vTechRetCost_csv.lp = 1;
vTechRetCost_csv.nd = 1;
vTechRetCost_csv.nz = 1e-25;
vTechRetCost_csv.nr = 2;
put vTechRetCost_csv;
put "tech,region,year,value"/;
loop((tech,region,year)$(vTechRetCost.l(tech,region,year) and mMidMilestone(year)), put tech.tl:0",", region.tl:0",", year.tl:0","vTechRetCost.l(tech,region,year):0:15/;);
putclose; 
file vTechFixom_csv / 'output/vTechFixom.csv'/;
vTechFixom_csv.lp = 1;
vTechFixom_csv.nd = 1;
vTechFixom_csv.nz = 1e-25;
vTechFixom_csv.nr = 2;
put vTechFixom_csv;
put "tech,region,year,value"/;
loop((tech,region,year)$(vTechFixom.l(tech,region,year) and mMidMilestone(year)), put tech.tl:0",", region.tl:0",", year.tl:0","vTechFixom.l(tech,region,year):0:15/;);
putclose; 
file vTechVarom_csv / 'output/vTechVarom.csv'/;
vTechVarom_csv.lp = 1;
vTechVarom_csv.nd = 1;
vTechVarom_csv.nz = 1e-25;
vTechVarom_csv.nr = 2;
put vTechVarom_csv;
put "tech,region,year,value"/;
loop((tech,region,year)$(vTechVarom.l(tech,region,year) and mMidMilestone(year)), put tech.tl:0",", region.tl:0",", year.tl:0","vTechVarom.l(tech,region,year):0:15/;);
putclose; 
file vSupCost_csv / 'output/vSupCost.csv'/;
vSupCost_csv.lp = 1;
vSupCost_csv.nd = 1;
vSupCost_csv.nz = 1e-25;
vSupCost_csv.nr = 2;
put vSupCost_csv;
put "sup,region,year,value"/;
loop((sup,region,year)$(vSupCost.l(sup,region,year) and mMidMilestone(year)), put sup.tl:0",", region.tl:0",", year.tl:0","vSupCost.l(sup,region,year):0:15/;);
putclose; 
file vEmsFuelTot_csv / 'output/vEmsFuelTot.csv'/;
vEmsFuelTot_csv.lp = 1;
vEmsFuelTot_csv.nd = 1;
vEmsFuelTot_csv.nz = 1e-25;
vEmsFuelTot_csv.nr = 2;
put vEmsFuelTot_csv;
put "comm,region,year,slice,value"/;
loop((comm,region,year,slice)$(vEmsFuelTot.l(comm,region,year,slice) and mMidMilestone(year)), put comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vEmsFuelTot.l(comm,region,year,slice):0:15/;);
putclose; 
file vBalance_csv / 'output/vBalance.csv'/;
vBalance_csv.lp = 1;
vBalance_csv.nd = 1;
vBalance_csv.nz = 1e-25;
vBalance_csv.nr = 2;
put vBalance_csv;
put "comm,region,year,slice,value"/;
loop((comm,region,year,slice)$(vBalance.l(comm,region,year,slice) and mMidMilestone(year)), put comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vBalance.l(comm,region,year,slice):0:15/;);
putclose; 
file vBalanceRY_csv / 'output/vBalanceRY.csv'/;
vBalanceRY_csv.lp = 1;
vBalanceRY_csv.nd = 1;
vBalanceRY_csv.nz = 1e-25;
vBalanceRY_csv.nr = 2;
put vBalanceRY_csv;
put "comm,region,year,value"/;
loop((comm,region,year)$(vBalanceRY.l(comm,region,year) and mMidMilestone(year)), put comm.tl:0",", region.tl:0",", year.tl:0","vBalanceRY.l(comm,region,year):0:15/;);
putclose; 
file vTotalCost_csv / 'output/vTotalCost.csv'/;
vTotalCost_csv.lp = 1;
vTotalCost_csv.nd = 1;
vTotalCost_csv.nz = 1e-25;
vTotalCost_csv.nr = 2;
put vTotalCost_csv;
put "region,year,value"/;
loop((region,year)$(vTotalCost.l(region,year) and mMidMilestone(year)), put region.tl:0",", year.tl:0","vTotalCost.l(region,year):0:15/;);
putclose; 
file vObjective_csv / 'output/vObjective.csv'/;
vObjective_csv.lp = 1;
vObjective_csv.nd = 1;
vObjective_csv.nz = 1e-25;
vObjective_csv.nr = 2;
put vObjective_csv;
put "value"/vObjective.l:0:15/;
putclose;
file vTaxCost_csv / 'output/vTaxCost.csv'/;
vTaxCost_csv.lp = 1;
vTaxCost_csv.nd = 1;
vTaxCost_csv.nz = 1e-25;
vTaxCost_csv.nr = 2;
put vTaxCost_csv;
put "comm,region,year,value"/;
loop((comm,region,year)$(vTaxCost.l(comm,region,year) and mMidMilestone(year)), put comm.tl:0",", region.tl:0",", year.tl:0","vTaxCost.l(comm,region,year):0:15/;);
putclose; 
file vSubsCost_csv / 'output/vSubsCost.csv'/;
vSubsCost_csv.lp = 1;
vSubsCost_csv.nd = 1;
vSubsCost_csv.nz = 1e-25;
vSubsCost_csv.nr = 2;
put vSubsCost_csv;
put "comm,region,year,value"/;
loop((comm,region,year)$(vSubsCost.l(comm,region,year) and mMidMilestone(year)), put comm.tl:0",", region.tl:0",", year.tl:0","vSubsCost.l(comm,region,year):0:15/;);
putclose; 
file vAggOutTot_csv / 'output/vAggOutTot.csv'/;
vAggOutTot_csv.lp = 1;
vAggOutTot_csv.nd = 1;
vAggOutTot_csv.nz = 1e-25;
vAggOutTot_csv.nr = 2;
put vAggOutTot_csv;
put "comm,region,year,slice,value"/;
loop((comm,region,year,slice)$(vAggOutTot.l(comm,region,year,slice) and mMidMilestone(year)), put comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vAggOutTot.l(comm,region,year,slice):0:15/;);
putclose; 
file vDummyImportCost_csv / 'output/vDummyImportCost.csv'/;
vDummyImportCost_csv.lp = 1;
vDummyImportCost_csv.nd = 1;
vDummyImportCost_csv.nz = 1e-25;
vDummyImportCost_csv.nr = 2;
put vDummyImportCost_csv;
put "comm,region,year,value"/;
loop((comm,region,year)$(vDummyImportCost.l(comm,region,year) and mMidMilestone(year)), put comm.tl:0",", region.tl:0",", year.tl:0","vDummyImportCost.l(comm,region,year):0:15/;);
putclose; 
file vDummyExportCost_csv / 'output/vDummyExportCost.csv'/;
vDummyExportCost_csv.lp = 1;
vDummyExportCost_csv.nd = 1;
vDummyExportCost_csv.nz = 1e-25;
vDummyExportCost_csv.nr = 2;
put vDummyExportCost_csv;
put "comm,region,year,value"/;
loop((comm,region,year)$(vDummyExportCost.l(comm,region,year) and mMidMilestone(year)), put comm.tl:0",", region.tl:0",", year.tl:0","vDummyExportCost.l(comm,region,year):0:15/;);
putclose; 
file vStorageFixom_csv / 'output/vStorageFixom.csv'/;
vStorageFixom_csv.lp = 1;
vStorageFixom_csv.nd = 1;
vStorageFixom_csv.nz = 1e-25;
vStorageFixom_csv.nr = 2;
put vStorageFixom_csv;
put "stg,region,year,value"/;
loop((stg,region,year)$(vStorageFixom.l(stg,region,year) and mMidMilestone(year)), put stg.tl:0",", region.tl:0",", year.tl:0","vStorageFixom.l(stg,region,year):0:15/;);
putclose; 
file vStorageVarom_csv / 'output/vStorageVarom.csv'/;
vStorageVarom_csv.lp = 1;
vStorageVarom_csv.nd = 1;
vStorageVarom_csv.nz = 1e-25;
vStorageVarom_csv.nr = 2;
put vStorageVarom_csv;
put "stg,region,year,value"/;
loop((stg,region,year)$(vStorageVarom.l(stg,region,year) and mMidMilestone(year)), put stg.tl:0",", region.tl:0",", year.tl:0","vStorageVarom.l(stg,region,year):0:15/;);
putclose; 
file vTradeEac_csv / 'output/vTradeEac.csv'/;
vTradeEac_csv.lp = 1;
vTradeEac_csv.nd = 1;
vTradeEac_csv.nz = 1e-25;
vTradeEac_csv.nr = 2;
put vTradeEac_csv;
put "trade,region,year,value"/;
loop((trade,region,year)$(vTradeEac.l(trade,region,year) and mMidMilestone(year)), put trade.tl:0",", region.tl:0",", year.tl:0","vTradeEac.l(trade,region,year):0:15/;);
putclose; 
file vTradeFixom_csv / 'output/vTradeFixom.csv'/;
vTradeFixom_csv.lp = 1;
vTradeFixom_csv.nd = 1;
vTradeFixom_csv.nz = 1e-25;
vTradeFixom_csv.nr = 2;
put vTradeFixom_csv;
put "trade,region,year,value"/;
loop((trade,region,year)$(vTradeFixom.l(trade,region,year) and mMidMilestone(year)), put trade.tl:0",", region.tl:0",", year.tl:0","vTradeFixom.l(trade,region,year):0:15/;);
putclose; 
file vImportIrCost_csv / 'output/vImportIrCost.csv'/;
vImportIrCost_csv.lp = 1;
vImportIrCost_csv.nd = 1;
vImportIrCost_csv.nz = 1e-25;
vImportIrCost_csv.nr = 2;
put vImportIrCost_csv;
put "trade,region,year,value"/;
loop((trade,region,year)$(vImportIrCost.l(trade,region,year) and mMidMilestone(year)), put trade.tl:0",", region.tl:0",", year.tl:0","vImportIrCost.l(trade,region,year):0:15/;);
putclose; 
file vExportIrCost_csv / 'output/vExportIrCost.csv'/;
vExportIrCost_csv.lp = 1;
vExportIrCost_csv.nd = 1;
vExportIrCost_csv.nz = 1e-25;
vExportIrCost_csv.nr = 2;
put vExportIrCost_csv;
put "trade,region,year,value"/;
loop((trade,region,year)$(vExportIrCost.l(trade,region,year) and mMidMilestone(year)), put trade.tl:0",", region.tl:0",", year.tl:0","vExportIrCost.l(trade,region,year):0:15/;);
putclose; 
file vImportRowCost_csv / 'output/vImportRowCost.csv'/;
vImportRowCost_csv.lp = 1;
vImportRowCost_csv.nd = 1;
vImportRowCost_csv.nz = 1e-25;
vImportRowCost_csv.nr = 2;
put vImportRowCost_csv;
put "imp,region,year,value"/;
loop((imp,region,year)$(vImportRowCost.l(imp,region,year) and mMidMilestone(year)), put imp.tl:0",", region.tl:0",", year.tl:0","vImportRowCost.l(imp,region,year):0:15/;);
putclose; 
file vExportRowCost_csv / 'output/vExportRowCost.csv'/;
vExportRowCost_csv.lp = 1;
vExportRowCost_csv.nd = 1;
vExportRowCost_csv.nz = 1e-25;
vExportRowCost_csv.nr = 2;
put vExportRowCost_csv;
put "expp,region,year,value"/;
loop((expp,region,year)$(vExportRowCost.l(expp,region,year) and mMidMilestone(year)), put expp.tl:0",", region.tl:0",", year.tl:0","vExportRowCost.l(expp,region,year):0:15/;);
putclose; 
file vTechNewCap_csv / 'output/vTechNewCap.csv'/;
vTechNewCap_csv.lp = 1;
vTechNewCap_csv.nd = 1;
vTechNewCap_csv.nz = 1e-25;
vTechNewCap_csv.nr = 2;
put vTechNewCap_csv;
put "tech,region,year,value"/;
loop((tech,region,year)$(vTechNewCap.l(tech,region,year) and mMidMilestone(year)), put tech.tl:0",", region.tl:0",", year.tl:0","vTechNewCap.l(tech,region,year):0:15/;);
putclose; 
file vTechRetiredStockCum_csv / 'output/vTechRetiredStockCum.csv'/;
vTechRetiredStockCum_csv.lp = 1;
vTechRetiredStockCum_csv.nd = 1;
vTechRetiredStockCum_csv.nz = 1e-25;
vTechRetiredStockCum_csv.nr = 2;
put vTechRetiredStockCum_csv;
put "tech,region,year,value"/;
loop((tech,region,year)$(vTechRetiredStockCum.l(tech,region,year) and mMidMilestone(year)), put tech.tl:0",", region.tl:0",", year.tl:0","vTechRetiredStockCum.l(tech,region,year):0:15/;);
putclose; 
file vTechRetiredStock_csv / 'output/vTechRetiredStock.csv'/;
vTechRetiredStock_csv.lp = 1;
vTechRetiredStock_csv.nd = 1;
vTechRetiredStock_csv.nz = 1e-25;
vTechRetiredStock_csv.nr = 2;
put vTechRetiredStock_csv;
put "tech,region,year,value"/;
loop((tech,region,year)$(vTechRetiredStock.l(tech,region,year) and mMidMilestone(year)), put tech.tl:0",", region.tl:0",", year.tl:0","vTechRetiredStock.l(tech,region,year):0:15/;);
putclose; 
file vTechRetiredNewCap_csv / 'output/vTechRetiredNewCap.csv'/;
vTechRetiredNewCap_csv.lp = 1;
vTechRetiredNewCap_csv.nd = 1;
vTechRetiredNewCap_csv.nz = 1e-25;
vTechRetiredNewCap_csv.nr = 2;
put vTechRetiredNewCap_csv;
put "tech,region,year,yearp,value"/;
loop((tech,region,year,yearp)$(vTechRetiredNewCap.l(tech,region,year,yearp) and mMidMilestone(year)), put tech.tl:0",", region.tl:0",", year.tl:0",", yearp.tl:0","vTechRetiredNewCap.l(tech,region,year,yearp):0:15/;);
putclose; 
file vTechCap_csv / 'output/vTechCap.csv'/;
vTechCap_csv.lp = 1;
vTechCap_csv.nd = 1;
vTechCap_csv.nz = 1e-25;
vTechCap_csv.nr = 2;
put vTechCap_csv;
put "tech,region,year,value"/;
loop((tech,region,year)$(vTechCap.l(tech,region,year) and mMidMilestone(year)), put tech.tl:0",", region.tl:0",", year.tl:0","vTechCap.l(tech,region,year):0:15/;);
putclose; 
file vTechAct_csv / 'output/vTechAct.csv'/;
vTechAct_csv.lp = 1;
vTechAct_csv.nd = 1;
vTechAct_csv.nz = 1e-25;
vTechAct_csv.nr = 2;
put vTechAct_csv;
put "tech,region,year,slice,value"/;
loop((tech,region,year,slice)$(vTechAct.l(tech,region,year,slice) and mMidMilestone(year)), put tech.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vTechAct.l(tech,region,year,slice):0:15/;);
putclose; 
file vTechInp_csv / 'output/vTechInp.csv'/;
vTechInp_csv.lp = 1;
vTechInp_csv.nd = 1;
vTechInp_csv.nz = 1e-25;
vTechInp_csv.nr = 2;
put vTechInp_csv;
put "tech,comm,region,year,slice,value"/;
loop((tech,comm,region,year,slice)$(vTechInp.l(tech,comm,region,year,slice) and mMidMilestone(year)), put tech.tl:0",", comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vTechInp.l(tech,comm,region,year,slice):0:15/;);
putclose; 
file vTechOut_csv / 'output/vTechOut.csv'/;
vTechOut_csv.lp = 1;
vTechOut_csv.nd = 1;
vTechOut_csv.nz = 1e-25;
vTechOut_csv.nr = 2;
put vTechOut_csv;
put "tech,comm,region,year,slice,value"/;
loop((tech,comm,region,year,slice)$(vTechOut.l(tech,comm,region,year,slice) and mMidMilestone(year)), put tech.tl:0",", comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vTechOut.l(tech,comm,region,year,slice):0:15/;);
putclose; 
file vTechAInp_csv / 'output/vTechAInp.csv'/;
vTechAInp_csv.lp = 1;
vTechAInp_csv.nd = 1;
vTechAInp_csv.nz = 1e-25;
vTechAInp_csv.nr = 2;
put vTechAInp_csv;
put "tech,comm,region,year,slice,value"/;
loop((tech,comm,region,year,slice)$(vTechAInp.l(tech,comm,region,year,slice) and mMidMilestone(year)), put tech.tl:0",", comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vTechAInp.l(tech,comm,region,year,slice):0:15/;);
putclose; 
file vTechAOut_csv / 'output/vTechAOut.csv'/;
vTechAOut_csv.lp = 1;
vTechAOut_csv.nd = 1;
vTechAOut_csv.nz = 1e-25;
vTechAOut_csv.nr = 2;
put vTechAOut_csv;
put "tech,comm,region,year,slice,value"/;
loop((tech,comm,region,year,slice)$(vTechAOut.l(tech,comm,region,year,slice) and mMidMilestone(year)), put tech.tl:0",", comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vTechAOut.l(tech,comm,region,year,slice):0:15/;);
putclose; 
file vSupOut_csv / 'output/vSupOut.csv'/;
vSupOut_csv.lp = 1;
vSupOut_csv.nd = 1;
vSupOut_csv.nz = 1e-25;
vSupOut_csv.nr = 2;
put vSupOut_csv;
put "sup,comm,region,year,slice,value"/;
loop((sup,comm,region,year,slice)$(vSupOut.l(sup,comm,region,year,slice) and mMidMilestone(year)), put sup.tl:0",", comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vSupOut.l(sup,comm,region,year,slice):0:15/;);
putclose; 
file vSupReserve_csv / 'output/vSupReserve.csv'/;
vSupReserve_csv.lp = 1;
vSupReserve_csv.nd = 1;
vSupReserve_csv.nz = 1e-25;
vSupReserve_csv.nr = 2;
put vSupReserve_csv;
put "sup,comm,region,value"/;
loop((sup,comm,region)$vSupReserve.l(sup,comm,region), put sup.tl:0",", comm.tl:0",", region.tl:0","vSupReserve.l(sup,comm,region):0:15/;);
putclose; 
file vDemInp_csv / 'output/vDemInp.csv'/;
vDemInp_csv.lp = 1;
vDemInp_csv.nd = 1;
vDemInp_csv.nz = 1e-25;
vDemInp_csv.nr = 2;
put vDemInp_csv;
put "comm,region,year,slice,value"/;
loop((comm,region,year,slice)$(vDemInp.l(comm,region,year,slice) and mMidMilestone(year)), put comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vDemInp.l(comm,region,year,slice):0:15/;);
putclose; 
file vOutTot_csv / 'output/vOutTot.csv'/;
vOutTot_csv.lp = 1;
vOutTot_csv.nd = 1;
vOutTot_csv.nz = 1e-25;
vOutTot_csv.nr = 2;
put vOutTot_csv;
put "comm,region,year,slice,value"/;
loop((comm,region,year,slice)$(vOutTot.l(comm,region,year,slice) and mMidMilestone(year)), put comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vOutTot.l(comm,region,year,slice):0:15/;);
putclose; 
file vOutTotRY_csv / 'output/vOutTotRY.csv'/;
vOutTotRY_csv.lp = 1;
vOutTotRY_csv.nd = 1;
vOutTotRY_csv.nz = 1e-25;
vOutTotRY_csv.nr = 2;
put vOutTotRY_csv;
put "comm,region,year,value"/;
loop((comm,region,year)$(vOutTotRY.l(comm,region,year) and mMidMilestone(year)), put comm.tl:0",", region.tl:0",", year.tl:0","vOutTotRY.l(comm,region,year):0:15/;);
putclose; 
file vInpTot_csv / 'output/vInpTot.csv'/;
vInpTot_csv.lp = 1;
vInpTot_csv.nd = 1;
vInpTot_csv.nz = 1e-25;
vInpTot_csv.nr = 2;
put vInpTot_csv;
put "comm,region,year,slice,value"/;
loop((comm,region,year,slice)$(vInpTot.l(comm,region,year,slice) and mMidMilestone(year)), put comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vInpTot.l(comm,region,year,slice):0:15/;);
putclose; 
file vInpTotRY_csv / 'output/vInpTotRY.csv'/;
vInpTotRY_csv.lp = 1;
vInpTotRY_csv.nd = 1;
vInpTotRY_csv.nz = 1e-25;
vInpTotRY_csv.nr = 2;
put vInpTotRY_csv;
put "comm,region,year,value"/;
loop((comm,region,year)$(vInpTotRY.l(comm,region,year) and mMidMilestone(year)), put comm.tl:0",", region.tl:0",", year.tl:0","vInpTotRY.l(comm,region,year):0:15/;);
putclose; 
file vInp2Lo_csv / 'output/vInp2Lo.csv'/;
vInp2Lo_csv.lp = 1;
vInp2Lo_csv.nd = 1;
vInp2Lo_csv.nz = 1e-25;
vInp2Lo_csv.nr = 2;
put vInp2Lo_csv;
put "comm,region,year,slice,slicep,value"/;
loop((comm,region,year,slice,slicep)$(vInp2Lo.l(comm,region,year,slice,slicep) and mMidMilestone(year)), put comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0",", slicep.tl:0","vInp2Lo.l(comm,region,year,slice,slicep):0:15/;);
putclose; 
file vOut2Lo_csv / 'output/vOut2Lo.csv'/;
vOut2Lo_csv.lp = 1;
vOut2Lo_csv.nd = 1;
vOut2Lo_csv.nz = 1e-25;
vOut2Lo_csv.nr = 2;
put vOut2Lo_csv;
put "comm,region,year,slice,slicep,value"/;
loop((comm,region,year,slice,slicep)$(vOut2Lo.l(comm,region,year,slice,slicep) and mMidMilestone(year)), put comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0",", slicep.tl:0","vOut2Lo.l(comm,region,year,slice,slicep):0:15/;);
putclose; 
file vSupOutTot_csv / 'output/vSupOutTot.csv'/;
vSupOutTot_csv.lp = 1;
vSupOutTot_csv.nd = 1;
vSupOutTot_csv.nz = 1e-25;
vSupOutTot_csv.nr = 2;
put vSupOutTot_csv;
put "comm,region,year,slice,value"/;
loop((comm,region,year,slice)$(vSupOutTot.l(comm,region,year,slice) and mMidMilestone(year)), put comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vSupOutTot.l(comm,region,year,slice):0:15/;);
putclose; 
file vTechInpTot_csv / 'output/vTechInpTot.csv'/;
vTechInpTot_csv.lp = 1;
vTechInpTot_csv.nd = 1;
vTechInpTot_csv.nz = 1e-25;
vTechInpTot_csv.nr = 2;
put vTechInpTot_csv;
put "comm,region,year,slice,value"/;
loop((comm,region,year,slice)$(vTechInpTot.l(comm,region,year,slice) and mMidMilestone(year)), put comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vTechInpTot.l(comm,region,year,slice):0:15/;);
putclose; 
file vTechOutTot_csv / 'output/vTechOutTot.csv'/;
vTechOutTot_csv.lp = 1;
vTechOutTot_csv.nd = 1;
vTechOutTot_csv.nz = 1e-25;
vTechOutTot_csv.nr = 2;
put vTechOutTot_csv;
put "comm,region,year,slice,value"/;
loop((comm,region,year,slice)$(vTechOutTot.l(comm,region,year,slice) and mMidMilestone(year)), put comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vTechOutTot.l(comm,region,year,slice):0:15/;);
putclose; 
file vStorageInpTot_csv / 'output/vStorageInpTot.csv'/;
vStorageInpTot_csv.lp = 1;
vStorageInpTot_csv.nd = 1;
vStorageInpTot_csv.nz = 1e-25;
vStorageInpTot_csv.nr = 2;
put vStorageInpTot_csv;
put "comm,region,year,slice,value"/;
loop((comm,region,year,slice)$(vStorageInpTot.l(comm,region,year,slice) and mMidMilestone(year)), put comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vStorageInpTot.l(comm,region,year,slice):0:15/;);
putclose; 
file vStorageOutTot_csv / 'output/vStorageOutTot.csv'/;
vStorageOutTot_csv.lp = 1;
vStorageOutTot_csv.nd = 1;
vStorageOutTot_csv.nz = 1e-25;
vStorageOutTot_csv.nr = 2;
put vStorageOutTot_csv;
put "comm,region,year,slice,value"/;
loop((comm,region,year,slice)$(vStorageOutTot.l(comm,region,year,slice) and mMidMilestone(year)), put comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vStorageOutTot.l(comm,region,year,slice):0:15/;);
putclose; 
file vStorageAInp_csv / 'output/vStorageAInp.csv'/;
vStorageAInp_csv.lp = 1;
vStorageAInp_csv.nd = 1;
vStorageAInp_csv.nz = 1e-25;
vStorageAInp_csv.nr = 2;
put vStorageAInp_csv;
put "stg,comm,region,year,slice,value"/;
loop((stg,comm,region,year,slice)$(vStorageAInp.l(stg,comm,region,year,slice) and mMidMilestone(year)), put stg.tl:0",", comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vStorageAInp.l(stg,comm,region,year,slice):0:15/;);
putclose; 
file vStorageAOut_csv / 'output/vStorageAOut.csv'/;
vStorageAOut_csv.lp = 1;
vStorageAOut_csv.nd = 1;
vStorageAOut_csv.nz = 1e-25;
vStorageAOut_csv.nr = 2;
put vStorageAOut_csv;
put "stg,comm,region,year,slice,value"/;
loop((stg,comm,region,year,slice)$(vStorageAOut.l(stg,comm,region,year,slice) and mMidMilestone(year)), put stg.tl:0",", comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vStorageAOut.l(stg,comm,region,year,slice):0:15/;);
putclose; 
file vDummyImport_csv / 'output/vDummyImport.csv'/;
vDummyImport_csv.lp = 1;
vDummyImport_csv.nd = 1;
vDummyImport_csv.nz = 1e-25;
vDummyImport_csv.nr = 2;
put vDummyImport_csv;
put "comm,region,year,slice,value"/;
loop((comm,region,year,slice)$(vDummyImport.l(comm,region,year,slice) and mMidMilestone(year)), put comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vDummyImport.l(comm,region,year,slice):0:15/;);
putclose; 
file vDummyExport_csv / 'output/vDummyExport.csv'/;
vDummyExport_csv.lp = 1;
vDummyExport_csv.nd = 1;
vDummyExport_csv.nz = 1e-25;
vDummyExport_csv.nr = 2;
put vDummyExport_csv;
put "comm,region,year,slice,value"/;
loop((comm,region,year,slice)$(vDummyExport.l(comm,region,year,slice) and mMidMilestone(year)), put comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vDummyExport.l(comm,region,year,slice):0:15/;);
putclose; 
file vStorageInp_csv / 'output/vStorageInp.csv'/;
vStorageInp_csv.lp = 1;
vStorageInp_csv.nd = 1;
vStorageInp_csv.nz = 1e-25;
vStorageInp_csv.nr = 2;
put vStorageInp_csv;
put "stg,comm,region,year,slice,value"/;
loop((stg,comm,region,year,slice)$(vStorageInp.l(stg,comm,region,year,slice) and mMidMilestone(year)), put stg.tl:0",", comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vStorageInp.l(stg,comm,region,year,slice):0:15/;);
putclose; 
file vStorageOut_csv / 'output/vStorageOut.csv'/;
vStorageOut_csv.lp = 1;
vStorageOut_csv.nd = 1;
vStorageOut_csv.nz = 1e-25;
vStorageOut_csv.nr = 2;
put vStorageOut_csv;
put "stg,comm,region,year,slice,value"/;
loop((stg,comm,region,year,slice)$(vStorageOut.l(stg,comm,region,year,slice) and mMidMilestone(year)), put stg.tl:0",", comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vStorageOut.l(stg,comm,region,year,slice):0:15/;);
putclose; 
file vStorageStore_csv / 'output/vStorageStore.csv'/;
vStorageStore_csv.lp = 1;
vStorageStore_csv.nd = 1;
vStorageStore_csv.nz = 1e-25;
vStorageStore_csv.nr = 2;
put vStorageStore_csv;
put "stg,comm,region,year,slice,value"/;
loop((stg,comm,region,year,slice)$(vStorageStore.l(stg,comm,region,year,slice) and mMidMilestone(year)), put stg.tl:0",", comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vStorageStore.l(stg,comm,region,year,slice):0:15/;);
putclose; 
file vStorageInv_csv / 'output/vStorageInv.csv'/;
vStorageInv_csv.lp = 1;
vStorageInv_csv.nd = 1;
vStorageInv_csv.nz = 1e-25;
vStorageInv_csv.nr = 2;
put vStorageInv_csv;
put "stg,region,year,value"/;
loop((stg,region,year)$(vStorageInv.l(stg,region,year) and mMidMilestone(year)), put stg.tl:0",", region.tl:0",", year.tl:0","vStorageInv.l(stg,region,year):0:15/;);
putclose; 
file vStorageEac_csv / 'output/vStorageEac.csv'/;
vStorageEac_csv.lp = 1;
vStorageEac_csv.nd = 1;
vStorageEac_csv.nz = 1e-25;
vStorageEac_csv.nr = 2;
put vStorageEac_csv;
put "stg,region,year,value"/;
loop((stg,region,year)$(vStorageEac.l(stg,region,year) and mMidMilestone(year)), put stg.tl:0",", region.tl:0",", year.tl:0","vStorageEac.l(stg,region,year):0:15/;);
putclose; 
file vStorageCap_csv / 'output/vStorageCap.csv'/;
vStorageCap_csv.lp = 1;
vStorageCap_csv.nd = 1;
vStorageCap_csv.nz = 1e-25;
vStorageCap_csv.nr = 2;
put vStorageCap_csv;
put "stg,region,year,value"/;
loop((stg,region,year)$(vStorageCap.l(stg,region,year) and mMidMilestone(year)), put stg.tl:0",", region.tl:0",", year.tl:0","vStorageCap.l(stg,region,year):0:15/;);
putclose; 
file vStorageNewCap_csv / 'output/vStorageNewCap.csv'/;
vStorageNewCap_csv.lp = 1;
vStorageNewCap_csv.nd = 1;
vStorageNewCap_csv.nz = 1e-25;
vStorageNewCap_csv.nr = 2;
put vStorageNewCap_csv;
put "stg,region,year,value"/;
loop((stg,region,year)$(vStorageNewCap.l(stg,region,year) and mMidMilestone(year)), put stg.tl:0",", region.tl:0",", year.tl:0","vStorageNewCap.l(stg,region,year):0:15/;);
putclose; 
file vImportTot_csv / 'output/vImportTot.csv'/;
vImportTot_csv.lp = 1;
vImportTot_csv.nd = 1;
vImportTot_csv.nz = 1e-25;
vImportTot_csv.nr = 2;
put vImportTot_csv;
put "comm,region,year,slice,value"/;
loop((comm,region,year,slice)$(vImportTot.l(comm,region,year,slice) and mMidMilestone(year)), put comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vImportTot.l(comm,region,year,slice):0:15/;);
putclose; 
file vExportTot_csv / 'output/vExportTot.csv'/;
vExportTot_csv.lp = 1;
vExportTot_csv.nd = 1;
vExportTot_csv.nz = 1e-25;
vExportTot_csv.nr = 2;
put vExportTot_csv;
put "comm,region,year,slice,value"/;
loop((comm,region,year,slice)$(vExportTot.l(comm,region,year,slice) and mMidMilestone(year)), put comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vExportTot.l(comm,region,year,slice):0:15/;);
putclose; 
file vTradeIr_csv / 'output/vTradeIr.csv'/;
vTradeIr_csv.lp = 1;
vTradeIr_csv.nd = 1;
vTradeIr_csv.nz = 1e-25;
vTradeIr_csv.nr = 2;
put vTradeIr_csv;
put "trade,comm,src,dst,year,slice,value"/;
loop((trade,comm,region,regionp,year,slice)$(vTradeIr.l(trade,comm,region,regionp,year,slice) and mMidMilestone(year)), put trade.tl:0",", comm.tl:0",", region.tl:0",", regionp.tl:0",", year.tl:0",", slice.tl:0","vTradeIr.l(trade,comm,region,regionp,year,slice):0:15/;);
putclose; 
file vTradeIrAInp_csv / 'output/vTradeIrAInp.csv'/;
vTradeIrAInp_csv.lp = 1;
vTradeIrAInp_csv.nd = 1;
vTradeIrAInp_csv.nz = 1e-25;
vTradeIrAInp_csv.nr = 2;
put vTradeIrAInp_csv;
put "trade,comm,region,year,slice,value"/;
loop((trade,comm,region,year,slice)$(vTradeIrAInp.l(trade,comm,region,year,slice) and mMidMilestone(year)), put trade.tl:0",", comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vTradeIrAInp.l(trade,comm,region,year,slice):0:15/;);
putclose; 
file vTradeIrAInpTot_csv / 'output/vTradeIrAInpTot.csv'/;
vTradeIrAInpTot_csv.lp = 1;
vTradeIrAInpTot_csv.nd = 1;
vTradeIrAInpTot_csv.nz = 1e-25;
vTradeIrAInpTot_csv.nr = 2;
put vTradeIrAInpTot_csv;
put "comm,region,year,slice,value"/;
loop((comm,region,year,slice)$(vTradeIrAInpTot.l(comm,region,year,slice) and mMidMilestone(year)), put comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vTradeIrAInpTot.l(comm,region,year,slice):0:15/;);
putclose; 
file vTradeIrAOut_csv / 'output/vTradeIrAOut.csv'/;
vTradeIrAOut_csv.lp = 1;
vTradeIrAOut_csv.nd = 1;
vTradeIrAOut_csv.nz = 1e-25;
vTradeIrAOut_csv.nr = 2;
put vTradeIrAOut_csv;
put "trade,comm,region,year,slice,value"/;
loop((trade,comm,region,year,slice)$(vTradeIrAOut.l(trade,comm,region,year,slice) and mMidMilestone(year)), put trade.tl:0",", comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vTradeIrAOut.l(trade,comm,region,year,slice):0:15/;);
putclose; 
file vTradeIrAOutTot_csv / 'output/vTradeIrAOutTot.csv'/;
vTradeIrAOutTot_csv.lp = 1;
vTradeIrAOutTot_csv.nd = 1;
vTradeIrAOutTot_csv.nz = 1e-25;
vTradeIrAOutTot_csv.nr = 2;
put vTradeIrAOutTot_csv;
put "comm,region,year,slice,value"/;
loop((comm,region,year,slice)$(vTradeIrAOutTot.l(comm,region,year,slice) and mMidMilestone(year)), put comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vTradeIrAOutTot.l(comm,region,year,slice):0:15/;);
putclose; 
file vExportRowCum_csv / 'output/vExportRowCum.csv'/;
vExportRowCum_csv.lp = 1;
vExportRowCum_csv.nd = 1;
vExportRowCum_csv.nz = 1e-25;
vExportRowCum_csv.nr = 2;
put vExportRowCum_csv;
put "expp,comm,value"/;
loop((expp,comm)$vExportRowCum.l(expp,comm), put expp.tl:0",", comm.tl:0","vExportRowCum.l(expp,comm):0:15/;);
putclose; 
file vExportRow_csv / 'output/vExportRow.csv'/;
vExportRow_csv.lp = 1;
vExportRow_csv.nd = 1;
vExportRow_csv.nz = 1e-25;
vExportRow_csv.nr = 2;
put vExportRow_csv;
put "expp,comm,region,year,slice,value"/;
loop((expp,comm,region,year,slice)$(vExportRow.l(expp,comm,region,year,slice) and mMidMilestone(year)), put expp.tl:0",", comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vExportRow.l(expp,comm,region,year,slice):0:15/;);
putclose; 
file vImportRowCum_csv / 'output/vImportRowCum.csv'/;
vImportRowCum_csv.lp = 1;
vImportRowCum_csv.nd = 1;
vImportRowCum_csv.nz = 1e-25;
vImportRowCum_csv.nr = 2;
put vImportRowCum_csv;
put "imp,comm,value"/;
loop((imp,comm)$vImportRowCum.l(imp,comm), put imp.tl:0",", comm.tl:0","vImportRowCum.l(imp,comm):0:15/;);
putclose; 
file vImportRow_csv / 'output/vImportRow.csv'/;
vImportRow_csv.lp = 1;
vImportRow_csv.nd = 1;
vImportRow_csv.nz = 1e-25;
vImportRow_csv.nr = 2;
put vImportRow_csv;
put "imp,comm,region,year,slice,value"/;
loop((imp,comm,region,year,slice)$(vImportRow.l(imp,comm,region,year,slice) and mMidMilestone(year)), put imp.tl:0",", comm.tl:0",", region.tl:0",", year.tl:0",", slice.tl:0","vImportRow.l(imp,comm,region,year,slice):0:15/;);
putclose; 
file vTradeCap_csv / 'output/vTradeCap.csv'/;
vTradeCap_csv.lp = 1;
vTradeCap_csv.nd = 1;
vTradeCap_csv.nz = 1e-25;
vTradeCap_csv.nr = 2;
put vTradeCap_csv;
put "trade,year,value"/;
loop((trade,year)$(vTradeCap.l(trade,year) and mMidMilestone(year)), put trade.tl:0",", year.tl:0","vTradeCap.l(trade,year):0:15/;);
putclose; 
file vTradeInv_csv / 'output/vTradeInv.csv'/;
vTradeInv_csv.lp = 1;
vTradeInv_csv.nd = 1;
vTradeInv_csv.nz = 1e-25;
vTradeInv_csv.nr = 2;
put vTradeInv_csv;
put "trade,region,year,value"/;
loop((trade,region,year)$(vTradeInv.l(trade,region,year) and mMidMilestone(year)), put trade.tl:0",", region.tl:0",", year.tl:0","vTradeInv.l(trade,region,year):0:15/;);
putclose; 
file vTradeNewCap_csv / 'output/vTradeNewCap.csv'/;
vTradeNewCap_csv.lp = 1;
vTradeNewCap_csv.nd = 1;
vTradeNewCap_csv.nz = 1e-25;
vTradeNewCap_csv.nr = 2;
put vTradeNewCap_csv;
put "trade,year,value"/;
loop((trade,year)$(vTradeNewCap.l(trade,year) and mMidMilestone(year)), put trade.tl:0",", year.tl:0","vTradeNewCap.l(trade,year):0:15/;);
putclose; 
file vTotalUserCosts_csv / 'output/vTotalUserCosts.csv'/;
vTotalUserCosts_csv.lp = 1;
vTotalUserCosts_csv.nd = 1;
vTotalUserCosts_csv.nz = 1e-25;
vTotalUserCosts_csv.nr = 2;
put vTotalUserCosts_csv;
put "region,year,value"/;
loop((region,year)$(vTotalUserCosts.l(region,year) and mMidMilestone(year)), put region.tl:0",", year.tl:0","vTotalUserCosts.l(region,year):0:15/;);
putclose; 
file variable_list_csv / 'output/variable_list.csv'/;
variable_list_csv.lp = 1;
put variable_list_csv;
    put "value"/;
    put "vTechInv"/;
    put "vTechEac"/;
    put "vTechRetCost"/;
    put "vTechFixom"/;
    put "vTechVarom"/;
    put "vSupCost"/;
    put "vEmsFuelTot"/;
    put "vBalance"/;
    put "vBalanceRY"/;
    put "vTotalCost"/;
    put "vObjective"/;
    put "vTaxCost"/;
    put "vSubsCost"/;
    put "vAggOutTot"/;
    put "vDummyImportCost"/;
    put "vDummyExportCost"/;
    put "vStorageFixom"/;
    put "vStorageVarom"/;
    put "vTradeEac"/;
    put "vTradeFixom"/;
    put "vImportIrCost"/;
    put "vExportIrCost"/;
    put "vImportRowCost"/;
    put "vExportRowCost"/;
    put "vTechNewCap"/;
    put "vTechRetiredStockCum"/;
    put "vTechRetiredStock"/;
    put "vTechRetiredNewCap"/;
    put "vTechCap"/;
    put "vTechAct"/;
    put "vTechInp"/;
    put "vTechOut"/;
    put "vTechAInp"/;
    put "vTechAOut"/;
    put "vSupOut"/;
    put "vSupReserve"/;
    put "vDemInp"/;
    put "vOutTot"/;
    put "vOutTotRY"/;
    put "vInpTot"/;
    put "vInpTotRY"/;
    put "vInp2Lo"/;
    put "vOut2Lo"/;
    put "vSupOutTot"/;
    put "vTechInpTot"/;
    put "vTechOutTot"/;
    put "vStorageInpTot"/;
    put "vStorageOutTot"/;
    put "vStorageAInp"/;
    put "vStorageAOut"/;
    put "vDummyImport"/;
    put "vDummyExport"/;
    put "vStorageInp"/;
    put "vStorageOut"/;
    put "vStorageStore"/;
    put "vStorageInv"/;
    put "vStorageEac"/;
    put "vStorageCap"/;
    put "vStorageNewCap"/;
    put "vImportTot"/;
    put "vExportTot"/;
    put "vTradeIr"/;
    put "vTradeIrAInp"/;
    put "vTradeIrAInpTot"/;
    put "vTradeIrAOut"/;
    put "vTradeIrAOutTot"/;
    put "vExportRowCum"/;
    put "vExportRow"/;
    put "vImportRowCum"/;
    put "vImportRow"/;
    put "vTradeCap"/;
    put "vTradeInv"/;
    put "vTradeNewCap"/;
    put "vTotalUserCosts"/;
 putclose;
file raw_data_set_csv / 'output/raw_data_set.csv'/;
raw_data_set_csv.lp = 1;
put raw_data_set_csv;
put "set,value"/;
loop(comm, put "comm,"comm.tl:0/;);
loop(region, put "region,"region.tl:0/;);
loop(year$mMidMilestone(year), put "year,"year.tl:0/;);
loop(slice, put "slice,"slice.tl:0/;);
loop(sup, put "sup,"sup.tl:0/;);
loop(dem, put "dem,"dem.tl:0/;);
loop(tech, put "tech,"tech.tl:0/;);
loop(stg, put "stg,"stg.tl:0/;);
loop(trade, put "trade,"trade.tl:0/;);
loop(expp, put "expp,"expp.tl:0/;);
loop(imp, put "imp,"imp.tl:0/;);
loop(group, put "group,"group.tl:0/;);
loop(weather, put "weather,"weather.tl:0/;);
putclose;
